<?php

	


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" src="lib/tree.js"></script>
<script language="javascript" src="lib/tree_tpl.js"></script>
<link rel="stylesheet" href="index.css" />

<script language="javascript">
var contentType = "application/x-www-form-urlencoded; charset=UTF-8";
var separator = "[|]";



function p(txt)
{
	
var ajax = getHTTPObject();
ajax.open("POST", "ajax.php", true);
	
ajax.onreadystatechange = function() 
	{
	    if (ajax.readyState == 4) 
	    {

		    var extra = document.getElementById("extra");
		    var extraContent = "";
		    var text = ajax.responseText.split(separator);
		    for(i = 0; i < text.length; i++)
		    {
		    	
		    	if(text[i] == "eval")
		    	{
		    		eval(text[++i]);
		    	}
		    	else if(text[i].length >0)
		    	{
		    		//alert(i + "-["+text[i]+"]");
			    	var element = document.getElementById(text[i]);
			    	
			    	
			    	if(element != null)
			    	{
			    		element.innerHTML = text[++i];
			    	}
			    	else
			    	{
			    		extraContent += text[i] + "<hr />";
			    	}
		    	}
		    	
		    }
		    extra.innerHTML = extraContent;
	    
	    }
	}
	ajax.setRequestHeader("Content-Type", contentType);

	ajax.send(txt);
	
}



function getHTTPObject() {
    if (typeof XMLHttpRequest != 'undefined') {
        return new XMLHttpRequest();
    }
    try {
        return new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            return new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {}
    }
    return false;
}


function login()
{
	var user = document.getElementById("username").value;
	p("&p=login&user="+user);
}


</script>
</head>
<body onload="javascript:p('&page=start');">
	<div id="container">
	
		<div id="header">
			<img src="img/logo.gif" />
		</div>
		
		<div id="menu">
			<ul>
				<li><a href=\"javascript:p('&page=start');\">index</a></li>
				<li><a href=\"javascript:p('&page=settings');\">settings</a></li>
				<li><a href=\"javascript:p('&page=projects');\">projects</a></li>
			</ul>
			
		</div>
		
		<div id="main"></div>
		
		<div id="copyrights"> &copy; Tiberiu Gal</div>
	</div>
	<div id="extra"></div>
</body>
</html>